<?php

namespace app\admin\model\store;

use app\common\model\TimeModel;

class GoodsCoupon extends TimeModel
{

    protected $name = "goods_coupon";

    protected $deleteTime = "delete_time";

    public function setStartTimeAttr($value)
    {
        return strtotime($value);
    }

    public function setEndTimeAttr($value)
    {
        return strtotime($value);
    }

    public function getDiscountMethodAttr($value)
    {
        $discountMethod = [1=>'满减',2=>'直减',3=>'折扣'];
        return $discountMethod[$value];
    }
}